<include file="/public/header" />
<include file="/public/header" />
<!-- // 重定位Style -->
<style>
    .layui-bg-white .layui-input {
        border:0px;
    }

    .layui-form-item .layui-input-inline {
        /*width: 220px;*/
    }
</style>

<!-- // 展示数据 -->
<div class="layui-fluid">
    <div class="layui-card">
        <!-- // 默认操作按钮 -->
        <div class="layui-card-header layadmin-card-header-auto ">
        <div class="layui-form">
            <div class="layui-form-item">

                <div class="layui-inline">
                    <select name="type">
                        <option value="">{:__('按分类查询')}</option>
                        <option value="user" >{:__('用户')}</option>                                 
                        <option value="system" >{:__('系统')}</option>                           
                    </select>
                </div> 

                <div class="layui-inline">
                    <div class="layui-input-inline">
                        <select name="status">
                            <option value="">{:__('按状态查询')}</option>
                            <option value="normal" >{:__('正常')}</option>                                 
                            <option value="error" >{:__('错误')}</option>                             
                        </select>
                    </div>  
                </div>

                <div class="layui-inline">
                    <div class="layui-input-inline ">
                        <input name="name" class="layui-input" type="text" placeholder="{:__('关键字搜索')}"/>
                    </div>
                </div>

                <div class="layui-inline" >
                    <!-- // 默认搜索 -->
                    <button class="layui-btn icon-btn" lay-filter="formSearch" lay-submit>
                        <i class="layui-icon layui-icon-search"></i>{:__('搜索')}</button>
                    <!-- // 删除所有 -->
                    <button class="layui-btn icon-btn layui-btn-danger" lay-batch="lay-tableList" data-table="lay-tableList" data-url="{:url('/system/SystemLog/del')}" >
                        <i class="layui-icon layui-icon-delete"></i>{:__('删除')}
                    </button>
                </div>
            </div>
        </div>   
        </div>

        <!-- // 创建数据实例 -->
        <table id="lay-tableList" lay-filter="lay-tableList"></table>        
    </div>
</div>

<!-- // 添加编辑数据 -->
<script type="text/html" id="viewforms" >
<div class="layui-fluid layui-bg-white" >

    <div class="layui-form " lay-filter="viewforms">
    <div class="layui-form-item">
        <label class="layui-form-label"><font color="red">* </font>{:__('操作模块')}：</label>
        <div class="layui-input-inline">
            <input type="text" name="module" class="layui-input">
        </div>
        <label class="layui-form-label"><font color="red">* </font>{:__('访问地址')}：</label>
        <div class="layui-input-inline">
            <input type="text" name="url" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><font color="red">* </font>{:__('登录信息')}：</label>
        <div class="layui-input-inline">
            <input type="text" name="name" class="layui-input">
        </div>
        <label class="layui-form-label"><font color="red">* </font>{:__('请求方式')}：</label>
        <div class="layui-input-inline">
            <input type="text" name="method" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label"><font color="red">* </font>{:__('路由方法')}：</label>
        <div class="layui-input-block">
            <input type="text" name="controller" class="layui-input" style="color:red">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><font color="red">* </font>{:__('请求参数')}：</label>
        <div class="layui-input-block">
            <input type="text" name="params" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><font color="red">* </font>{:__('错误信息')}：</label>
        <div class="layui-input-block">
            <input type="text" name="error" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><font color="red">* </font>{:__('文件地址')}：</label>
        <div class="layui-input-block">
            <input type="text" name="file" class="layui-input" style="color:red">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><font color="red">* </font>{:__('代码行数')}：</label>
        <div class="layui-input-inline">
            <input type="text" name="line" class="layui-input" style="color:red">
        </div>
        <label class="layui-form-label"><font color="red">* </font>{:__('操作时间')}：</label>
        <div class="layui-input-inline">
            <input type="text" name="create_time" class="layui-input">
        </div>
    </div>
    </div>
</div>
</script>

<!-- // 列表编辑框 -->
<script type="text/html" id="tableBar"> 
    <a class="layui-table-text" data-title="{:__('操作日志详情')}" data-url="#viewforms" data-area="680px" lay-event="edit" >{:__('详情')}</a>
</script>


<include file="/public/footer" />
<script>
    layui.use(['table'], function () {

        var table = layui.table;  
        // 初始化表
        var isTable = table.render({
            elem: "#lay-tableList"
            ,url: "{:url('/system/SystemLog/index')}"
            ,toolbar: '#tableButton'
            ,defaultToolbar: ['filter', 'exports', 'print', 'search']
            ,limit: 18
            ,page: true
            ,cols: [[
                {type: 'checkbox'},
                {field: 'id', align: 'center',sort: true,width: 80,  title: 'ID'},
                {field: 'module', align: 'center',width: 130, title: '{:__("模块")}'},
                {field: 'controller', align: 'center',templet:function(d){
                    var html = '<div ';
                    if (d.line) {
                        html += 'style="color:red;"';
                    }
                    html += '>'+  d.controller + "\\" + d.action + ' </div>';
                    return html;
                }, title: '{:__("控制器/方法")}'},
                {field: 'params', align: 'center', title: '{:__("参数")}'},
                {field: 'method', align: 'center',width: 130, title: '{:__("请求方式")}'},
                {field: 'code', align: 'center',width: 130,  title: '{:__("状态码")}'},
                {field: 'name', align: 'center',width: 130,  title: '{:__("操作人员")}'},
                {field: 'ip', align: 'center',width: 160, title: '{:__("IP地址")}'},
                {field: 'create_time', align: 'center', width: 160,title: '{:__("创建时间")}'},
                {align: 'center', toolbar: '#tableBar',width: 100, title: '{:__("操作")}'},
            ]]
        })

    });
</script>
